﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="~/layui/css/layui.css">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.2.0/css/all.css" rel="stylesheet">
    <title>首页</title>
    <style>
        .bigbd {
            height: 180px;
        }

        .smbd {
            height: 110px;
        }

        .bd {
            width: 25%;
            margin-top: 10px;
            float: left;
            text-align: center;
        }
    </style>
</head>
<body>
    <!-- 内容主体区域 -->
    <div style="padding: 20px; background-color: #F2F2F2;">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">快捷管理</div>
                    <div class="layui-card-body">
                        <div id="fm" class="smbd">
                        </div>
                    </div>
                </div>
            </div>
            <!--员工关系-->
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">员工关系</div>
                    <div class="layui-card-body">
                        <div id="yggx" class="bigbd">
                        </div>
                    </div>
                </div>
            </div>
            <!--end 员工关系-->
            <!--薪酬绩效-->
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">薪酬绩效</div>
                    <div class="layui-card-body">
                        <div id="xcjx" class="bigbd">
                        </div>
                    </div>
                </div>
            </div>
            <!--end 薪酬绩效-->
            <!--数据查询及分析-->
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">数据查询及分析</div>
                    <div class="layui-card-body">
                        <div id="sjcx" class="bigbd">
                        </div>
                    </div>
                </div>
            </div>
            <!--end 数据查询及分析-->
        </div>
    </div>


    <script src="~/layui/layui.js"></script>
    <script>
        //获取快捷菜单数据库
        function GetMenuTreeData() {
            var data = [];
            $.ajax({
                url: "/Menu/GetMenuTreeData",
                type: "post",
                async: false,
                success: function (result) {
                    data = result;
                }
            });
            return data;
        };

        //添加快捷菜单div
        layui.use(['element', 'jquery'], function () {
            var element = layui.element;
            var $ = layui.$;

            var data = GetMenuTreeData();
            var listr = "";
            var yggxlistr = "";
            var xcjx = "";
            var sjcx = "";
            //var defaultlistr = "<div class=\"bd\"><a href=\"\"><i class=\"fa  fa-plus-circle\" style=\"font-size: 50px; \"></i><br /><span>添加</span></a></div>";
            for (var i = 0; i < 5; i++) {
                listr += "<div class=\"bd\"><a href=\"" + data[i].menuURL + "\"><br /><span>" + data[i].name + "</span></a></div>";
            }

            $("#fm").html(listr);

            //员工关系
            for (var a = 0; a < data.length; a++) {
                if (data[a].parentId == 1)
                    yggxlistr += "<div class=\"bd\"><a href=\"" + data[a].menuURL + "\"><i class=\"" + data[a].icon + "\" style=\"font-size: 50px; \"></i><br /><span>" + data[a].name + "</span></a></div>";
            }
            $("#yggx").html(yggxlistr);

            //薪酬绩效
            for (var a = 0; a < data.length; a++) {
                if (data[a].parentId == 10)
                    xcjx += "<div class=\"bd\"><a href=\"" + data[a].menuURL + "\"><i class=\"" + data[a].icon + "\" style=\"font-size: 50px; \"></i><br /><span>" + data[a].name + "</span></a></div>";
            }
            $("#xcjx").html(xcjx);

            //数据查询
            for (var a = 0; a < data.length; a++) {
                if (data[a].parentId == 13)
                    sjcx += "<div class=\"bd\"><a href=\"" + data[a].menuURL + "\"><i class=\"" + data[a].icon + "\" style=\"font-size: 50px; \"></i><br /><span>" + data[a].name + "</span></a></div>";
            }
            $("#sjcx").html(sjcx);

        });
    </script>
</body>
</html>
